﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.AutoCAD.DatabaseServices;

namespace Galaxy.AutoCAD.Databases
{
    public static class BlockTableRecordTool
    {
        public static bool IsContainBlockReference(this BlockTableRecord btr)
        {
            int i = 0;
            foreach (ObjectId outId in btr)
            {
                DBObject dBObj = outId.GetObject(OpenMode.ForRead);
                if (dBObj is BlockReference)
                {
                    i++;
                }
            }
            if (i == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
    }
}
